<%--
  Created by IntelliJ IDEA.
  User: yangbushudemao
  Date: 2021/5/4
  Time: 10:34
  To change this template use File | Settings | File Templates.
--%><%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/common/common.jsp"%>
<html>
<head>
    <title>zengjia</title>
</head>
<body>
<div class="panel-body">
    <form id="loginForm">
        <input type="hidden" name="cid" >
        cname:<input type="text" name="cname" ><br>
        cprice:
                <input type="hidden" name="cprice"><br>
                <input type="file" id="myFile" name="myFile" ><br>
        cdate:<input type="date" name="cdate" value="<fmt:formatDate pattern='yyyy-MM-dd' type='date' value='${list.cdate}'/>"><br>
        tid:<select name="tid">
        <option value="-1" <c:if test="${list.tid == -1}">selected</c:if> >请选择</option>
        <option value="1" <c:if test="${list.tid == 1}">selected</c:if> >轿车</option>
        <option value="2" <c:if test="${list.tid == 2}">selected</c:if>  >客车</option>
        <option value="3" <c:if test="${list.tid == 3}">selected</c:if>  >越野车</option>
        <option value="4" <c:if test="${list.tid == 4}">selected</c:if>  >牵引车</option>
    </select>
    </form>
</div>
</body>
</html>
<script>

 $("#myFile").fileinput({
     language: 'zh',//汉化
     uploadUrl: "<%=path%>/file/uploadFile",//上传地址
     //showCaption: true,//是否展示显示框
     //showUpload: true,//默认为true, false不显示上传按钮
     //showRemove: true,//默认为true,false不显示移除按钮
     //showClose: true,//默认为true, false不显示图片右上角的关闭按钮
 browseClass: 'btn btn-primary',
     //showPreview: true,
     //showUploadedThumbs: true
     //showBrowse:["txt",""],
     //autoReplace:true,
     allowedFileExtensions: ['jpg', 'png', 'gif', 'txt', 'pdf', 'xls', 'xlsx'], //限制文件上传类型
     maxFileSize: 2048,//设置文件上传大小 单位kb
     maxFileCount: 1,//最大上传数量
     enctype: "multipart/form-data"
 });

 //上传成功回调
 $("#myFile").on('fileuploaded', function (event, data, previewId, index) {
     if (data.response != null) {
         $("[name=cprice]").val(data.response.imgUrl);//abc.jpg  + "," + bcd.jpg
     }
 })

</script>
